from rest_framework.viewsets import ModelViewSet, GenericViewSet
from rest_framework import mixins
from rest_framework.response import Response
from orders.models import LogisticsCompany
from orders.serializers import LogisticsCompanySerializer


# Create your views here.
class LogisticsCompanyView(mixins.CreateModelMixin, mixins.DestroyModelMixin, mixins.RetrieveModelMixin, mixins.ListModelMixin, GenericViewSet):
     queryset = LogisticsCompany.objects.all()
     serializer_class = LogisticsCompanySerializer

     def list(self, request, *args, **kwargs):
          serializer = self.get_serializer(self.queryset, many=True)

          return Response(serializer.data)